import Vue from "vue";
import Vuex from "vuex";
import axios from "axios"

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    professionTypes:[],
  },
  mutations: {
    setProfessionTypes(state,payload){
      state.professionTypes = payload;
    }
  },
  actions: {
    getProfessionTypes({commit}){
      axios({
              method: "get",
              url: "/ceto/common/professionTypes",
            }).then(
              (res) => {
                commit("setProfessionTypes",res.data)
              },
              (error) => {
                console.log(" request error : "+error.response.status);
              }
            );
    }
  },
  modules: {},
});
